home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxcvalue.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  1.7 KB  |  43 lines

  1. /* Copyright (C) 1995, 1996 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxcvalue.h,v 1.2 2000/09/19 19:00:35 lpd Exp $ */
  20. /* Definition of device color values */
  21.  
  22. #ifndef gxcvalue_INCLUDED
  23. #  define gxcvalue_INCLUDED
  24.  
  25. /* Define the type for gray or RGB values at the driver interface. */
  26. typedef unsigned short gx_color_value;
  27.  
  28. #define arch_sizeof_gx_color_value arch_sizeof_short
  29. /* We might use less than the full range someday. */
  30. /* ...bits must lie between 8 and 16. */
  31. #define gx_color_value_bits (sizeof(gx_color_value) * 8)
  32. #define gx_max_color_value ((gx_color_value)((1L << gx_color_value_bits) - 1))
  33. #define gx_color_value_to_byte(cv)\
  34.   ((cv) >> (gx_color_value_bits - 8))
  35. #define gx_color_value_from_byte(cb)\
  36.   (((cb) << (gx_color_value_bits - 8)) + ((cb) >> (16 - gx_color_value_bits)))
  37.  
  38. /* Convert between gx_color_values and fracs. */
  39. #define frac2cv(fr) frac2ushort(fr)
  40. #define cv2frac(cv) ushort2frac(cv)
  41.  
  42. #endif /* gxcvalue_INCLUDED */
  43.